package com.didispace.web;

import com.didispace.web.fallback.ComputeApiFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author liangqq
 */
@FeignClient(value = "compute-service-feign",
        // fallbackFactory = ComputeApiFallback.class,
        configuration = {NotBreakerConfiguration.class})
public interface ComputeApi {

    @RequestMapping(value = "/addFeign" ,method = RequestMethod.GET)
    Integer addFeign(@RequestParam Integer a, @RequestParam Integer b);

    /**
     * 模拟抛出业务异常
     * @return
     */
    @RequestMapping(value = "/throwsBizException" ,method = RequestMethod.GET)
    Integer throwsBizException();
}
